/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sgii;

import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 *
 * @author Franco
 */
public class Formatter {
    
    public static final int STRING = 1;
    public static final int INTEGER = 2;
    public static final int DATE = 3;
    
    static public String getFormattedString(String toFormat,Integer type){
        switch(type) {
            case 1:
                return "'" + toFormat + "'";
            case 2:
                return toFormat;
            case 3:
                Calendar cal = Calendar.getInstance();
                try {
                  SimpleDateFormat format = new SimpleDateFormat("MM/dd/ffryyyy");
                  format.parse(toFormat);
                  return getFormattedString(toFormat, 1);
                }catch (Exception e) {
                    return "'01/01/1901'";
                }
                
        }
        return "";
    }
    
}
